
#ifndef STATEMUSEUM_H
#define STATEMUSEUM_H

#include "GameState.h"
#include "Singleton.h"
#include "RenderableEntity.h"
#include "TextEntity.h"
#include "TimeLineEffect.h"
#include "AchievementData.h"
#include "Container.h"

#define ITEMS_PER_PAGE  9
#define NUM_PAGES       4 //(int)ceilf(MAX_ACHIEVEMENTS / ITEMS_PER_PAGE)

enum eMuseumState {MUSEUM_ENTER, MUSEUM_IDLE, MUSEUM_PAGING, MUSEUM_TOUCHING, MUSEUM_EXIT};

class StateMuseum : public GameState, public Singleton<StateMuseum>
{
private:
    
    eMuseumState m_eState;

    int m_iPage;
    int m_iPacifier;
    
    RenderableEntity* m_oBg;
    RenderableEntity* m_oTitleBg;
    TextEntity* m_oTitleText;
    
    Container* m_oItemsPage[NUM_PAGES];
    RenderableEntity* m_oItemsBg[NUM_PAGES];
    RenderableEntity* m_oItemMarker;
    RenderableEntity* m_oItems[MAX_ACHIEVEMENTS];
    
    TextEntity* m_oName;
    TextEntity* m_oDescription;
    RenderableEntity* m_oPages[NUM_PAGES];

    RenderableEntity* m_oBack;
    
    TimeLineEffect* m_oEnter;
    TimeLineEffect* m_oExit;
    
    Vector2 m_vLastMousePos;
    float m_fPageDisplacement;
    float m_fTouchTime;
    
    float m_fInitPageDisplacement;
    float m_fInitDisplacementTime;

public:
    
	StateMuseum(){}
	~StateMuseum(){}
    
    void loadContent();
	void unloadContent();
    
	void enter();
    void update(float dt);
    void render();
    void exit();
};

#endif
